<template>
  <div>
    <table class="table table-bordered">
      <tr>
        <td>借款名称</td>
        <td>还款金额</td>
      </tr>
      <tr v-for="item in list">
        <td>{{ item.BName }}</td>
        <td>{{ item.UBRMoney }}</td>
      </tr>
    </table>
  </div>
</template>

<script setup lang="ts">
import { reactive, toRefs, onMounted } from 'vue';
import axios from 'axios';
import { useRoute, useRouter } from 'vue-router';
import { useStore } from '../store/use';
const store = useStore();
const router = useRouter();
const route = useRoute();

let data: any = reactive({
  list: []
});

let { list } = toRefs(data);

onMounted(() => {
  getlist();
});

const getlist = () => {
  axios({
    url: '/api/Users/GetRedeemList',
    method: 'get',
    params: {
      userId: store.userInfo.userId
    }
  })
    .then((res) => {
      console.log(res);
      list.value = res.data.data;
    })
    .catch((err) => {
      console.log(err);
    });
};
</script>

<style scoped></style>
